Skip to content

fix(fish): honor GO_TASK_PROGNAME for experiments cache#2730

Open
SergioChan wants to merge 1 commit intogo-task:mainfrom
SergioChan:fix-fish-completion-progname-2727
Open

fix(fish): honor GO_TASK_PROGNAME for experiments cache#2730
SergioChan wants to merge 1 commit intogo-task:mainfrom
SergioChan:fix-fish-completion-progname-2727

Conversation

@SergioChan
Copy link
Contributor

Summary

  • use $GO_TASK_PROGNAME instead of hardcoded task when refreshing fish completion experiment cache
  • fixes fish completion warnings on distros where the binary name is go-task
  • keeps completion behavior unchanged for default task installs

Testing

  • git diff --check
  • go test ./... (not runnable in this environment: required Go toolchain go1.25 is unavailable via GOTOOLCHAIN download)

Related

@trulede trulede added the area: completions Changes related to shell completions and scripts. label Mar 15, 2026
Copy link
Contributor

@trulede trulede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix seems OK.
I'm not familiar with fish and can't verify.

@appenzellergeller
Copy link

I did face the same issue today and have already tried the fix as it is proposed in this PR.
This will unfortunately not work in any case.

The are situations where the __go_task_is_experiment_enabled is called from another script and then the variable $GO_TASK_PROGNAME has not been defined in that scope.

If you add the --inherit-variable GO_TASK_PROGNAME to the function then it will work. See below.

function __go_task_get_experiments --inherit-variable GO_TASK_PROGNAME
[...]
    # Refresh cache
    set -g __go_task_experiments_cache ($GO_TASK_PROGNAME --experiments 2>/dev/null)
[...]
end

Copy link
Contributor

@trulede trulede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you check if the suggested changes are viable/working:

function __go_task_get_experiments --inherit-variable GO_TASK_PROGNAME
[...]
    # Refresh cache
    set -g __go_task_experiments_cache ($GO_TASK_PROGNAME --experiments 2>/dev/null)
[...]
end

@vmaerten vmaerten self-requested a review March 18, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: completions Changes related to shell completions and scripts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task completion with the fish shell raise a warning when distro use the go-task name instead of task

3 participants